{extend name="public:base"/}


{block name="title"}编辑广告位{/block}

{block name="style"}
<link href="__STATIC__/admin/plugin/my_uploader/css/uploads.css" rel="stylesheet">
{/block}

{block name="main"}

<section class="content" xmlns="http://www.w3.org/1999/html">
    <div class="row">

        <div class="col-md-12">

            <div class="row">
                <div class="col-lg-12">
                    <div class="box">
                        <div class="box-header with-border">
                            <h3 class="box-title">编辑广告位</h3>
                        </div>
                        <form  id="pt_form" method="post">
                            <div class="box-body">

                                <input type="hidden" name="id" value="<?=$model['id']?>" ?>
                                <div class="clearfix"></div>

     
                                <div class="form-group required">
                                    <div class='col-sm-2 text-right'>
                                        <label for="ap_name" class="control-label Validform_label" >广告位置名称</label>
                                    </div>
                                    <div class='col-sm-10'>
                                        <input type="text" id="ap_name" class="form-control" name="ap_name" placeholder="请输入广告位置名称" value="<?=$model['ap_name']?>" datatype="s2-100"  errormsg="广告位置名称名超出长度范围">
                                        <div class="help-block"></div>
                                    </div>
                                </div>
          
                                <div class="form-group required">
                                    <div class="col-sm-2 text-right">
                                        <label class="control-label Validform_label">广告位是否启用                                        </label>
                                    </div>

                                    <div class="col-sm-10">
                                        <div>
                                      
                                            <span style="color:#636f7a"><input type="radio" name="is_use" value="0" datatype="n"  errormsg="请选择广告位是否启用" <?=$model['is_use']==0?'checked="checked"':''?>>禁用</span>

                                            
                                            <span style="color:#636f7a"><input type="radio" name="is_use" value="1" <?=$model['is_use']==1?'checked="checked"':''?> >启用</span>

                                                                                    </div>
                                        <div class="help-block"></div>
                                    </div>
                                </div>


     
                                <div class="form-group required">
                                    <div class='col-sm-2 text-right'>
                                        <label for="ap_height" class="control-label Validform_label" >广告位高度</label>
                                    </div>
                                    <div class='col-sm-10'>
                                        <input type="text" id="ap_height" class="form-control" name="ap_height" placeholder="请输入广告位高度" value="<?=$model['ap_height']?>" datatype="n"  errormsg="广告位高度是数字类型">
                                        <div class="help-block"></div>
                                    </div>
                                </div>
          
                                <div class="form-group required">
                                    <div class='col-sm-2 text-right'>
                                        <label for="ap_width" class="control-label Validform_label" >广告位宽度</label>
                                    </div>
                                    <div class='col-sm-10'>
                                        <input type="text" id="ap_width" class="form-control" name="ap_width" placeholder="请输入广告位宽度" value="<?=$model['ap_width']?>" datatype="n"  errormsg="广告位宽度是数字类型">
                                        <div class="help-block"></div>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <div class='col-sm-2 text-right'>
                                        <label for="ap_width" class="control-label Validform_label" >广告图片</label>
                                    </div>
                                    <div class='col-sm-10'>
                                        <div class="test">
                                            <div class="up-button" id="select-img">选择图片</div>
                                            <div class="img-list" id="img-list">
                                                <!--图片列表样例-->
                                                <div class="img-item">
                                                    <?=showImage($model['logo'])?>
                                                    <input type="hidden" name="logo" value="<?=$model['logo']?>" />
                                                    <em class="delete" onclick="uploader.del_list(this)">×</em>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
               
                                <div class="form-group required">
                                    <div class="col-sm-2 text-right">
                                        <label class="control-label Validform_label">广告位所在位置类型                                        </label>
                                    </div>

                                    <div class="col-sm-10">
                                        <div>
                                      
                                            <span style="color:#636f7a"><input type="radio" name="type" value="1" <?=$model['type']==1?'checked="checked"':''?>>PC端</span>

                                            
                                            <span style="color:#636f7a"><input type="radio" name="type" value="2" <?=$model['type']==2?'checked="checked"':''?>>手机端</span>

                                                                                    </div>
                                        <div class="help-block"></div>
                                    </div>
                                </div>


                            </div>
                            <div class="box-footer text-center">
                                <button class="btn btn-primary" type="submit">保存</button>
                                <span class="btn btn-white" onclick="history.go(-1)">返回</span>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</section>
{/block}

{block name="js"}
<script src="__STATIC__/admin/plugin/my_uploader/js/uploads.js"></script>
<script>

    var validate = validator('#pt_form');
    $('#select-img').click(function(){
        uploader.open({
            elm:'select-img',//选择图片上传的按钮
            url:"<?=url('common/AjaxController/uploader',['path'=>'adv'])?>",//服务器url
            up_type:1,//上传图片类型1:单图,2:多图
            img_list:'img-list',//存放选择图片之后的容器
            input_name:'logo',//上传图片表单ID
            img_num:6,//多图上传的总数
            num:2
        });
    });
</script>
{/block}